<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
<div class="pageContent">
	<form method="post" action="school_bindEcinfo.action" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
	<input name="sclId" type="hidden" value="${sclId}">
		<div class="pageFormContent nowrap" layoutH="56">
				<dl>
				   <dt><label>学校名称：</label></dt>
				  <input type="text" class="input-xlarge" name="sclName"  value="${sclName }" disabled/>
				</dl>
				<dl>
				   <dt><label>集团客户：</label></dt>
				   <select name="ecId" class="combox">
						<c:forEach items="${ecinfoList}" var="ecinfo">   
                      		<option value="${ecinfo.ecId}">${ecinfo.ecName}</option>
                  		</c:forEach>
					</select>
				</dl>
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>
 --%>
 <script type="text/javascript">
<!--
function bind_ecinfoUi_tr_click(ecId,ecName){
	var bindLink = $("#bind_ecinfoUi_btn_bind", $.pdialog.getCurrent());
	var sclName = $("#bind_ecinfoUI_el_sclName", $.pdialog.getCurrent());
	bindLink.attr("href",bindLink.attr("href2")+"&ecName="+ecName+"&sclName="+sclName.val())
	var ecId = $("#bind_ecinfoUI_el_ecid", $.pdialog.getCurrent()).val(ecId);
}

function bind_ecInfo_bind(){
	var sclId = $("#bind_ecinfoUI_el_sclId", $.pdialog.getCurrent()).val();
	var ecId = $("#bind_ecinfoUI_el_ecid", $.pdialog.getCurrent()).val();
	$.post("school_bindEcinfo.action", {ecId: ecId,sclId:sclId}, function(json){
		navTabAjaxDone(json);
	}, "json");
}

function bind_ecInfo_confirm(json){
	if(json.statusCode==200){
		if(json.message=="true"){
			bind_ecInfo_bind();
		}else{
			alertMsg.confirm("选中集团客户与学校名称相差较大，请再次确认是否绑定？", {
			 okCall: function(){
				 bind_ecInfo_bind();
			 },
			 cancelCall : function() {}
			}); 
		}
	}else{
		navTabAjaxDone(json);
	}
	
}
//-->
</script>
<form id="pagerForm" action="#rel#">
	<input type="hidden" name="pageNum" value="${currentPage }" />
	<input type="hidden" name="numPerPage" value="${numPerPage}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
</form>

<div class="pageHeader">
	<form rel="pagerForm" method="post" action="school_bindEcinfoUI.action" onsubmit="return dwzSearch(this, 'dialog');">
	<input id="bind_ecinfoUI_el_sclId" type="hidden" name="sclId" value="${sclId}" />
	<input id="bind_ecinfoUI_el_sclName" type="hidden" name="sclName" value="${sclName}" />
	<input id="bind_ecinfoUI_el_ecid" type="hidden"  />
	<div class="searchBar">
		<table class="searchContent" style="width: 100%;">
			<tr>
				<td>
					<label>学校名称：</label>
					<span style="color: blue;line-height: 23px;">${sclName}</span>
					</select>
				</td>
				<td>
					<label>客户名称：</label>
					<input type="text" name="ecName" value="${ecName }" />
				</td>
				<td>
					<div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">检索</button>
						</div>
					</div>
				</td>
				<td align="right">
					<div class="buttonActive">
						<div class="buttonContent">
							<a id="bind_ecinfoUi_btn_bind" href2="school_checkEcId.action?ecId={ecinfo_ecid}" href="school_checkEcId.action?ecId={ecinfo_ecid}"  
							target="ajaxTodo" mask="true" callback="bind_ecInfo_confirm"  warn="请在列表选中要绑定的集团客户！" title="确定要绑定该集团客户吗？">
								<button>确认绑定</button>
							</a>
						</div>
					</div>
				</td>
			</tr>
		</table>
	</div>
	</form>
</div>
<div class="pageContent">
	<table class="table" layoutH="90" targetType="dialog" width="100%">
		<thead>
			<tr>
				<th orderfield="ecId">集团客户ID</th>
				<th orderfield="ecName">集团客户名称</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="ecInfo" items="${recordList}" varStatus="status">
			<tr target="ecinfo_ecid" rel="${ecInfo.ecId}" onclick="bind_ecinfoUi_tr_click('${ecInfo.ecId}','${ecInfo.ecName}')" >
				<td>${ecInfo.ecId }</td>
				<td>${ecInfo.ecName }</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>

	<div class="panelBar">
		
		<div class="pages">
			<span>页次&nbsp;${currentPage }&nbsp;/&nbsp;${pageCount }&nbsp;页，</span>
			<span>显示&nbsp;</span>
			<select class="combox" name="numPerPage"
				onchange="dwzPageBreak({targetType:dialog, numPerPage:'10'})">
				<option ${numPerPage==10?"selected":"" } value="10">10</option>
			</select>
			<span>&nbsp;条，共${recordCount}条</span>
		</div>
		
		<div class="pagination" targetType="dialog" totalCount="${recordCount}" numPerPage="${pageSize}" pageNumShown="${pageNumShown}"
		currentPage="${currentPage }"></div>
		
	</div>
</div>